package com.googlecode.animator.controller
{
	import com.googlecode.animator.data.Notifications;
	import com.googlecode.data.cameras.ActualViewCameraVO;
	import com.googlecode.data.markers.KeyframeVO;
	import com.googlecode.data.objects3d.CameraProxyVO;
	import com.googlecode.data.objects3d.TargetProxyVO;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	
	/**
	 * Adds cameras to the model. 
	 * @author USER
	 * 
	 */
	public class AddCameraProxiesCommand extends BaseCommand
	{
		/**
		 * Executes command. 
		 * @param notification
		 * 
		 */
		public override function execute(notification:INotification):void
		{
			//var defaultXML:XML = notification.getBody() as XML;
			var cProxy:CameraProxyVO = new CameraProxyVO();
			var defaultActualCamera:ActualViewCameraVO = new ActualViewCameraVO();
			
			//cProxy.name = CameraProxy.NAME;

			cProxy.x = defaultActualCamera.x;
			cProxy.y = defaultActualCamera.y;
			cProxy.z = defaultActualCamera.z;
			
			sendNotification(Notifications.ADD_OBJECT3D_MODEL, cProxy);

			var tProxy:TargetProxyVO = new TargetProxyVO();
			
			//tProxy.name = TargetProxy.NAME;
			tProxy.rotationX = 90;
			tProxy.x = defaultActualCamera.target.x;
			tProxy.y = defaultActualCamera.target.y;
			tProxy.z = defaultActualCamera.target.z;
			
			sendNotification(Notifications.ADD_OBJECT3D_MODEL, tProxy);
			
			sendNotification(Notifications.CAMERA_PROXIES_ADDED_MODEL); 
		}
		
	}
}